using System;
using System.Xml;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Configuration;

namespace NBox.Service
{
    /// <summary>
    /// </summary>
    public abstract class BaseConfigurationSetting
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="xmlNode"></param>
        public BaseConfigurationSetting(XmlNode xmlNode)
        {
            this.node = xmlNode;
            properties = AttributeToNameValueCollection(xmlNode.Attributes);
        }

        private XmlNode node;
        /// <summary>
        /// </summary>
        /// <value></value>
        protected XmlNode XmlNode
        {
            get { return node; }
        }

        private NameValueCollection properties;
        public NameValueCollection Properties
        {
            get { return properties; }
        }

        private NameValueCollection AttributeToNameValueCollection(XmlAttributeCollection attributes)
        {
            NameValueCollection nameValue = new NameValueCollection();
            foreach (XmlAttribute att in attributes)
            {
                nameValue.Add(att.Name, att.Value);
            }
            return nameValue;
        }

    }
}
